import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/equipment_inspection_ledger_entity.dart';

EquipmentInspectionLedgerEntity $EquipmentInspectionLedgerEntityFromJson(Map<String, dynamic> json) {
  final EquipmentInspectionLedgerEntity equipmentInspectionLedgerEntity = EquipmentInspectionLedgerEntity();
  final int? auditStatus = jsonConvert.convert<int>(json['auditStatus']);
  if (auditStatus != null) {
    equipmentInspectionLedgerEntity.auditStatus = auditStatus;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    equipmentInspectionLedgerEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    equipmentInspectionLedgerEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    equipmentInspectionLedgerEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    equipmentInspectionLedgerEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    equipmentInspectionLedgerEntity.deleted = deleted;
  }
  final String? equipmentId = jsonConvert.convert<String>(json['equipmentId']);
  if (equipmentId != null) {
    equipmentInspectionLedgerEntity.equipmentId = equipmentId;
  }
  final String? equipmentName = jsonConvert.convert<String>(json['equipmentName']);
  if (equipmentName != null) {
    equipmentInspectionLedgerEntity.equipmentName = equipmentName;
  }
  final String? equipmentType = jsonConvert.convert<String>(json['equipmentType']);
  if (equipmentType != null) {
    equipmentInspectionLedgerEntity.equipmentType = equipmentType;
  }
  final List<String>? fileUrl = (json['fileUrl'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (fileUrl != null) {
    equipmentInspectionLedgerEntity.fileUrl = fileUrl;
  }
  final String? hazardCode = jsonConvert.convert<String>(json['hazardCode']);
  if (hazardCode != null) {
    equipmentInspectionLedgerEntity.hazardCode = hazardCode;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    equipmentInspectionLedgerEntity.id = id;
  }
  final String? inspectionDate = jsonConvert.convert<String>(json['inspectionDate']);
  if (inspectionDate != null) {
    equipmentInspectionLedgerEntity.inspectionDate = inspectionDate;
  }
  final int? inspectionResultStatus = jsonConvert.convert<int>(json['inspectionResultStatus']);
  if (inspectionResultStatus != null) {
    equipmentInspectionLedgerEntity.inspectionResultStatus = inspectionResultStatus;
  }
  final String? inspector = jsonConvert.convert<String>(json['inspector']);
  if (inspector != null) {
    equipmentInspectionLedgerEntity.inspector = inspector;
  }
  final String? inspectorId = jsonConvert.convert<String>(json['inspectorId']);
  if (inspectorId != null) {
    equipmentInspectionLedgerEntity.inspectorId = inspectorId;
  }
  final String? isBoiler = jsonConvert.convert<String>(json['isBoiler']);
  if (isBoiler != null) {
    equipmentInspectionLedgerEntity.isBoiler = isBoiler;
  }
  final int? isOnTimeInspection = jsonConvert.convert<int>(json['isOnTimeInspection']);
  if (isOnTimeInspection != null) {
    equipmentInspectionLedgerEntity.isOnTimeInspection = isOnTimeInspection;
  }
  final String? notes = jsonConvert.convert<String>(json['notes']);
  if (notes != null) {
    equipmentInspectionLedgerEntity.notes = notes;
  }
  final List<String>? outerFileUrl = (json['outerFileUrl'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (outerFileUrl != null) {
    equipmentInspectionLedgerEntity.outerFileUrl = outerFileUrl;
  }
  final String? outerInspectionDate = jsonConvert.convert<String>(json['outerInspectionDate']);
  if (outerInspectionDate != null) {
    equipmentInspectionLedgerEntity.outerInspectionDate = outerInspectionDate;
  }
  final int? outerInspectionResultStatus = jsonConvert.convert<int>(json['outerInspectionResultStatus']);
  if (outerInspectionResultStatus != null) {
    equipmentInspectionLedgerEntity.outerInspectionResultStatus = outerInspectionResultStatus;
  }
  final String? outerInspector = jsonConvert.convert<String>(json['outerInspector']);
  if (outerInspector != null) {
    equipmentInspectionLedgerEntity.outerInspector = outerInspector;
  }
  final String? outerInspectorId = jsonConvert.convert<String>(json['outerInspectorId']);
  if (outerInspectorId != null) {
    equipmentInspectionLedgerEntity.outerInspectorId = outerInspectorId;
  }
  final int? outerIsOnTimeInspection = jsonConvert.convert<int>(json['outerIsOnTimeInspection']);
  if (outerIsOnTimeInspection != null) {
    equipmentInspectionLedgerEntity.outerIsOnTimeInspection = outerIsOnTimeInspection;
  }
  final String? outerNotes = jsonConvert.convert<String>(json['outerNotes']);
  if (outerNotes != null) {
    equipmentInspectionLedgerEntity.outerNotes = outerNotes;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    equipmentInspectionLedgerEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    equipmentInspectionLedgerEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    equipmentInspectionLedgerEntity.updateDate = updateDate;
  }
  return equipmentInspectionLedgerEntity;
}

Map<String, dynamic> $EquipmentInspectionLedgerEntityToJson(EquipmentInspectionLedgerEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['auditStatus'] = entity.auditStatus;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['equipmentId'] = entity.equipmentId;
  data['equipmentName'] = entity.equipmentName;
  data['equipmentType'] = entity.equipmentType;
  data['fileUrl'] = entity.fileUrl;
  data['hazardCode'] = entity.hazardCode;
  data['id'] = entity.id;
  data['inspectionDate'] = entity.inspectionDate;
  data['inspectionResultStatus'] = entity.inspectionResultStatus;
  data['inspector'] = entity.inspector;
  data['inspectorId'] = entity.inspectorId;
  data['isBoiler'] = entity.isBoiler;
  data['isOnTimeInspection'] = entity.isOnTimeInspection;
  data['notes'] = entity.notes;
  data['outerFileUrl'] = entity.outerFileUrl;
  data['outerInspectionDate'] = entity.outerInspectionDate;
  data['outerInspectionResultStatus'] = entity.outerInspectionResultStatus;
  data['outerInspector'] = entity.outerInspector;
  data['outerInspectorId'] = entity.outerInspectorId;
  data['outerIsOnTimeInspection'] = entity.outerIsOnTimeInspection;
  data['outerNotes'] = entity.outerNotes;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension EquipmentInspectionLedgerEntityExtension on EquipmentInspectionLedgerEntity {
  EquipmentInspectionLedgerEntity copyWith({
    int? auditStatus,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? equipmentId,
    String? equipmentName,
    String? equipmentType,
    List<String>? fileUrl,
    String? hazardCode,
    String? id,
    String? inspectionDate,
    int? inspectionResultStatus,
    String? inspector,
    String? inspectorId,
    String? isBoiler,
    int? isOnTimeInspection,
    String? notes,
    List<String>? outerFileUrl,
    String? outerInspectionDate,
    int? outerInspectionResultStatus,
    String? outerInspector,
    String? outerInspectorId,
    int? outerIsOnTimeInspection,
    String? outerNotes,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return EquipmentInspectionLedgerEntity()
      ..auditStatus = auditStatus ?? this.auditStatus
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..equipmentId = equipmentId ?? this.equipmentId
      ..equipmentName = equipmentName ?? this.equipmentName
      ..equipmentType = equipmentType ?? this.equipmentType
      ..fileUrl = fileUrl ?? this.fileUrl
      ..hazardCode = hazardCode ?? this.hazardCode
      ..id = id ?? this.id
      ..inspectionDate = inspectionDate ?? this.inspectionDate
      ..inspectionResultStatus = inspectionResultStatus ?? this.inspectionResultStatus
      ..inspector = inspector ?? this.inspector
      ..inspectorId = inspectorId ?? this.inspectorId
      ..isBoiler = isBoiler ?? this.isBoiler
      ..isOnTimeInspection = isOnTimeInspection ?? this.isOnTimeInspection
      ..notes = notes ?? this.notes
      ..outerFileUrl = outerFileUrl ?? this.outerFileUrl
      ..outerInspectionDate = outerInspectionDate ?? this.outerInspectionDate
      ..outerInspectionResultStatus = outerInspectionResultStatus ?? this.outerInspectionResultStatus
      ..outerInspector = outerInspector ?? this.outerInspector
      ..outerInspectorId = outerInspectorId ?? this.outerInspectorId
      ..outerIsOnTimeInspection = outerIsOnTimeInspection ?? this.outerIsOnTimeInspection
      ..outerNotes = outerNotes ?? this.outerNotes
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
